﻿
using B.S.GridManage.Api.Read.Application.Command.LogicalGrid;
using B.S.GridManage.Api.Read.Dtos;
using B.S.GridManage.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.GridManage.Api.Read.Controllers
{
    /// <summary>
    /// 逻辑网格控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class LogicalGridController : ControllerBase
    {
        private readonly IMediator mediator;

        public LogicalGridController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 查询逻辑网格分页接口
        /// </summary>
        /// <param name="request">查询参数</param>
        /// <returns> 响应结果</returns>

        [HttpGet]
        public Task<ApiPaging<LogicalDto>> GetLogicalGridPage([FromQuery]GetLogicalGridCommand request) { 
        return  mediator.Send(request);
        }
    }
}
